﻿using System.Collections;
using System.Collections.Generic;
using UnityEngine;
using Yunchang;

public class HeroItem : MonoBehaviour
{
    public CommonIcon heroIcon;
    public GameObject heroGetted;

    private int heroId;
    public void Refresh(PackageHero heroData)
    {
        gameObject.SetActive(true);
        heroId = heroData.heroId;
        heroGetted.SetActive(heroData.isGetted);
        heroIcon.Refresh(heroData.itemBase, -1, true);
        heroIcon.SetFrame(heroData.frameName);
        heroIcon.ClickItemFunc = ()=> 
        {
            PageManager.Instance.OpenPage("ChessPokedexPage", heroId);
        };
    }
}
